<?php

namespace App\Http\Requests;


/**
 * 微信短链接验证器
 * @package App\Http\Requests
 */
class AdminWxShorturlPost extends AdminBaseRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'name' => 'required',
            'long_url' => 'required|url',
        ];
    }

    /**
     * 定义错误信息
     * @return array
     */
    public function messages()
    {
        return [
            'name.required' => '链接名称不能为空',
            'long_url.required' => '长连接地址不能为空',
            'long_url.url' => '长连接地址无效',
        ];
    }
}
